1. Field of the Invention
This invention relates generally to comparators, and more particularly to ping pong comparators employed to monitor an input voltage.
2. Description of the Related Art
One method of monitoring the level of a given voltage is to use a comparator circuit. Here, a reference voltage (Vref) and the voltage to be monitored (Vin) are applied to the inputs of a comparator, the output of which toggles when Vin increases above or falls below Vref. To provide highly accurate monitoring, the comparator may be periodically auto-zeroed to avoid offset drift which can degrade accuracy. To achieve continuous monitoring, two comparators can be used in a ‘ping pong’ configuration, which allows one comparator to keep monitoring while the other is being auto-zeroed. However, this periodic switching comes with a side effect: a parasitic offset mismatch between the two comparators could potentially yield different comparison results, even if both Vin and Vref remain constant. As a result, the comparator output could become a periodic square wave if Vin is close to Vref.
This problem can be mitigated by adding hysteresis onto the comparator input; however, simply adding a fixed amount of hysteresis onto both comparators can result in additional problems. For example, for reliable operation, the minimum hysteresis value for the individual comparators needs to be larger than the offset mismatch between the two comparators. Depending on the mismatch, this could result in large hysteresis values. This could degrade the monitoring accuracy, especially if Vin is a low voltage for which the hysteresis would be a large percentage of the input threshold. Another drawback is that the hysteresis value needed can vary over time and with changes in the offset mismatch.
This is illustrated with reference to FIG. 1, which depicts a basic voltage monitoring circuit 10 that uses a ping pong comparator circuit. First and second comparators ‘1’ and ‘2’ are used to monitor an input voltage Vin, which is provided to both comparators. A multiplexer 16 (or “mux”) is connected to receive the outputs of the first and second comparators at first and second inputs, respectively, and to receive a periodic control signal (CLK) at a ‘select’ input 18. The mux is arranged to alternately couple the voltage applied to its first and second inputs to its output OUT in response to CLK. Thus, each comparator is switched in for half of the clock period, allowing the other to be auto-zeroed in ping-pong fashion. Mux output OUT is the output of the voltage monitoring circuit.
Reference voltage Vref is applied to the other input of each comparator. However, due to offset mismatch, represented in FIG. 1 as a fixed voltage source ‘offset’ (which can be positive, negative or zero), the actual value to which Vin is compared by each comparator can be different. As noted above, this can be addressed by adding hysteresis, represented in FIG. 1 as a fixed voltage source ‘hyst’. The hysteresis is typically arranged to be switched in series between Vref and the comparators when mux output OUT is low, which indicates a rising Vin value; the hysteresis is then bypassed when OUT is high.
When the offset mismatch is zero, the rising and falling trip thresholds for comparator 1 (Vrise1 and Vfall1) are given by:Vrise1=Vref+hyst±0 (due to zero offset)Vfall1=Vref±0When Vrise1 and Vfall1 are the rising and falling thresholds, respectively, the hysteresis voltage (Vhyst1) for comparator 1 is given by:Vhyst1=Vrise1−Vfall1=hystThe rising and falling trip thresholds for comparator 2 (Vrise2 and Vfall2) are given by:Vrise2=Vref+hystVfall2=VrefThe hysteresis voltage (Vhyst2) for comparator 2 is given by:Vhyst2=Vrise2−Vfall2=hystThus, in this ideal case, both comparators have the same rising and falling thresholds, closely resembling a circuit employing only one comparator.
If the offset mismatch between the two comparators is not zero, then the rising and falling trip thresholds and the hysteresis voltage for comparator 1 (Vrise1, Vfall1, Vhyst1) are given by:Vrise1=Vref+hyst±offsetVfall1=Vref±offsetVhyst1=Vrise1−Vfall1=hystwhere offset=|offset1−offset2| and offset1 and offset2 are the offset voltages associated with comparators 1 and 2, respectively.
The rising and falling trip thresholds and hysteresis voltage for comparator 2 (Vrise2, Vfall2, Vhyst2) are given by:Vrise2=Vref+hystVfall2=VrefVhyst2=Vrise2−Vfall2=hyst
Although the two comparators share the same input hysteresis value (hyst), they have different rising and falling thresholds. If one comparator's falling threshold is higher than the other's rising threshold, a potential output disagreement between the two comparators can be caused by an input voltage that is at a level between the two thresholds, in which case one comparator determines that OUT should be high and another determines it should be low. Due to the nature of the ping pong comparators, only one comparator determines the output at a time. But because of the periodic switching of the comparators, if Vin remains constant, an output disagreement could create a square wave waveform at OUT.
Simply adding more hysteresis to the comparators could solve this output switching problem, but the hysteresis value would be required to be larger than the offset mismatch between the comparators. This makes it difficult to use a small hysteresis value, which tends to reduce the voltage monitoring accuracy. Also, the effective hysteresis can vary with the offset mismatch, and thus vary from part to part.